package com.sa.commons.web.mvc.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class HttpObject {
	private static ThreadLocal<HttpSession> httpSessions = new ThreadLocal<HttpSession>();

	private static ThreadLocal<HttpServletRequest> httpRequests = new ThreadLocal<HttpServletRequest>();

	private static ThreadLocal<HttpServletResponse> httpResponses=new ThreadLocal<HttpServletResponse>();
	
	public static void setHttpSession(HttpSession httpSession) {
		httpSessions.set(httpSession);
	}

	public static HttpSession getHttpSession() {
		return httpSessions.get();
	}

	public static void setHttpServletRequest(HttpServletRequest httpRequest) {
		httpRequests.set(httpRequest);
	}

	public static HttpServletRequest getHttpServletRequest() {
		return httpRequests.get();
	}

	public static HttpServletResponse getHttpResponse() {
		return httpResponses.get();
	}

	public static void setHttpResponse(HttpServletResponse httpResponse) {
		httpResponses.set(httpResponse);
	}
	
}
